﻿using Nop.Core.Domain.Catalog;
using Nop.Core.Domain.Common;
using Nop.Core.Domain.Customers;
using Nop.Core.Domain.Orders;
using Nop.Core.Domain.Shipping;
using Nop.Services.Payments;
using System;
using System.Collections.Generic;

namespace Nop.Services.Logistics
{
    public interface IOrderProcessingService
    {
        Charge CaculateTotal(LocationInformation locationInfo, Customer customer);
        Charge CaculateTotal(OrderInformation orderInfo, Customer customer);
        Charge CaculateTotal(Customer customer, bool caculateSum, bool isCommerce, params PackageInformation[] packages);
        ChargeRule GetChargeRule(Customer customer);
        string GetPackageAttributeDescription(PackageInformation packageInfo);
        string GetPackageAttributeXml(PackageInformation pi, IList<ProductVariantAttribute> productVariantAttributes, int customerId, int addressId);
        string GetPackageInfoString(PackageInformation packageInfo);
        void GetPickuptime(LocationInformation li, Address pickupAddress, out DateTime? readyTime, out DateTime? pickupEndTime);
        ProductVariant GetProdcutVariant(Customer customer);
        bool HasPendingOrders(Customer customer);
        bool IsMembershipExpired(Customer customer);
        bool IsPaymentExempt(Customer customer);
        OrderInformation LoadOrderInformation(Customer customer);
        int PlaceOrder(OrderInformation oi, Customer customer, int? boundOrderId = null, bool createShipments = true, bool paymentRequired = true, bool isLogisticOrder = false);
        int PlaceOrderWithoutShipment(OrderInformation oi, Customer customer, Charge charge, int packageId, int boundOrderId, bool isMailingReceiver = false, bool isModifyPackageOrder = false);
        void RemoveCurrentOrder(Customer customer, bool removeGiftCards = false);
        void SaveOrderInformation(OrderInformation oi, Customer customer);
        void SavePaymentInformation(ProcessPaymentRequest processPaymentRequest, Customer customer = null);
        ProcessPaymentRequest LoadPaymentInformation(Customer customer);
        void RemovePaymentInformation(Customer customer);
        string GetValidatedPickupTime(LocationInformation li, OrderKind orderKind, string zipPostalCode, AddressType type, out string warning);
        List<PackageInformation> GetConvertedPackages(IEnumerable<PackageInformation> packages);
        PackageInformation GetConvertedPackage(PackageInformation package);
        void SendLogisticPlacedNotification(int orderId);
    }
}
